package com.icarsaas.saas.tenant.common.web;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * 通用controller，多用于选择框，附件下载等通用组件
 * @author xr120 xrong@gmail.com
 * 2021年2月1日
 */
@Controller @RequestMapping(value = "/common/")
public class CommonController {

//	@Autowired BaseService baseService;

	/**
	 * 图标选择
	 * @return
	 */
	@GetMapping("/iconselect")
	public String iconselect() {
		return "/base/iconselect";
	}
//	/**
//	 * 用户选择
//	 * @param model
//	 * @param multi : 前端传入值，0-单选；1-多选
//	 * @return
//	 * @throws UnsupportedEncodingException
//	 */
//	@GetMapping("/userSelect")
//	public String userSelect(Model model, String multi) throws UnsupportedEncodingException {
//		if (StringUtils.isNotEmpty(multi)) model.addAttribute("multi", URLDecoder.decode(multi, "UTF-8"));
//		return "/base/userSelect";
//	}
//
//	@SuppressWarnings("unchecked")
//	@RequestMapping(value = "listUserData") @ResponseBody
//	public Object listUserData(IPager<Map<String, Object>> pager, HttpServletRequest request, HttpServletResponse response) {
//		Map<String, Object> map = pager.getParams();
//		Page<Map<String, Object>> page = baseService.listUserData(pager.pageParams(request, response), map);
//		return pager.pageResult(page);
//	}

}
